<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        div {
            width: 100px;
            height: 100px;
        }
        .box1 {
            position: absolute;
            background-color: aqua;
        }
        .box2 {
            background-color: red;
            position: absolute;

        }
    </style>
</head>
<body>
    <div class="box1"></div>
    <div class="box2"></div>
    <!-- 
        绝对定位只会影响后面得元素不会使前面的元素发生变化
        前面的绝对定位后汇票到上层后面的div会先插到下面在绝对定位跑到最上层所以显示的是最后面的绝对定位元素
     -->
</body>
</html>